<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 改变this指向
        function fun(){
            console.log(this);
            console.log(name);
        }
        fun("李四"); //window
        var arr = [];
        // 函数名.call(新的this指向,实参1,实参2,...)
        // fun.call(arr,"lili");//[]

        // 函数名.apply(新的this指向,[实参1,实参2,...])
        // fun.apply(arr,["lili"]);

        // 函数名.bind(新的this指向,[实参1,实参2,...])
        fun.bind(arr,"lili")();

    </script>
</body>
</html>